package components.editor
{
	import UIFree.ObjectEvent;
	import UIFree.command.ICommand;
	import UIFree.command.uif_commandManager;
	import UIFree.uif_component;
	
	import classes.Commands.c_linkCommand;
	import classes.c_events;
	import classes.c_locale;
	
	import components.c_component;
	import components.c_pcomponent;
	
	public class c_editedElement extends c_component {
		private static var _instanceNum: int=0;
		public function c_editedElement(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, styleClass:Object='') {
			_instanceNum++;
			name = nameClass() + _instanceNum;
			super(parent, ax, ay, awidth, aheight, styleClass);
		}		
		
		protected function nameClass(): String {
			return locale.ELEMENT;
		}
		
		public function setParent(a_parent: c_pcomponent, a_index: int=-1): void {
			if (a_index > -1) a_parent.addChildAt(this, a_index);
			else a_parent.addChildAt(this, a_parent.numChildren);
			cl.workspace.dispatchEvent(new ObjectEvent(c_events.ADDEDLAYER, this));
		}
		
		public function getHistoryData(): Object {
			return {}
		}
		
		public function setHistoryData(a_data: Object): void {
		}
		
		public function get editor(): c_baseEditor {
			return parent?(parent.parent as c_baseEditor):null;
		}
		
		public function get editMode(): Boolean {
			return false;
		}
		
		public function set editMode(a_set: Boolean): void {
			setEditMode(a_set);
		}
		
		protected function setEditMode(a_set: Boolean): void {
			
		}
		
		public function get actions(): Array {
			return getActions();
		}
		
		protected function getActions(): Array {
			return null;
		}
	}
}